from django.db import models
from classapp.models import Class
# Create your models here.
class Student(models.Model):
    GENDER_CHOICES = [("M", "男"), ("F", "女")]

    student_id = models.CharField("学号", max_length=20, primary_key=True)
    name = models.CharField("姓名", max_length=50)
    gender = models.CharField("性别", max_length=1, choices=GENDER_CHOICES)
    id_card = models.CharField("身份证号", max_length=18, unique=True)
    photo = models.ImageField("照片", upload_to="students/")
    _class = models.ForeignKey("classapp.Class", on_delete=models.CASCADE, verbose_name="所属班级")
